package com.wjh.configcenter.config;

import com.alibaba.nacos.api.annotation.NacosInjected;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Author 韦建韩
 * @Date 2024/1/17
 */

@Component
public class Test {

@NacosInjected
    private ConfigService configService;

    @PostConstruct
    public void aVoid() throws NacosException {
        String config = configService.getConfig("test", "DEFAULT_GROUP", 5000);
        System.out.println(config);
    }

}
